//
//  DetailJXCCCell.m
//  KuWoCan
//
//  Created by hwd on 17/3/6.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "DetailJXCCCell.h"

@interface DetailJXCCCell ()

@property (nonatomic,strong) UIImageView *headerImageV;

@property (nonatomic,strong) UILabel *guiGeLab;

@property (nonatomic,strong) UILabel *TitleLab;

@property (nonatomic,strong) UILabel *numberLab;

@end


@implementation DetailJXCCCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
    }
    return self;
    
}
-(void)loadCellWith:(NSDictionary *)dataDic
{
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    
    _headerImageV = [[UIImageView alloc]initWithFrame:CGRectMake(15*screenW_6, 15*screenW_6, 80*screenW_6, 80*screenW_6)];
    [_headerImageV sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"youme"]];
    [self.contentView addSubview:_headerImageV];
    
    _TitleLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_headerImageV.frame)+10*screenW_6, 15*screenW_6, SCREENW-110*screenW_6, 30*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:16*screenW_6] textColor:[UIColor blackColor] text:@"奶嘴型 草莓味 乳酸饮料"];
    [self.contentView addSubview:_TitleLab];
    

    _guiGeLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_headerImageV.frame)+10*screenW_6,CGRectGetMaxY(_TitleLab.frame), SCREENW-110*screenW_6, 25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:14*screenW_6] textColor:[UIColor blackColor] text:@"规格：100MLx2"];
    [self.contentView addSubview:_guiGeLab];
    
    _numberLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_headerImageV.frame)+10*screenW_6,CGRectGetMaxY(_guiGeLab.frame), SCREENW-110*screenW_6, 25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:15*screenW_6] textColor:[UIColor colorWithHexString:@"ff6000"] text:@"100箱"];
    [self.contentView addSubview:_numberLab];
    
    [self.contentView addSubview:[ToolViewViewController addCellLineLab:CGRectMake(0, 109*screenW_6, SCREENW, 1*screenW_6)]];
}

- (void)setModel:(ESSListModel *)model
{
    _model = model;
    [_headerImageV sd_setImageWithURL:[NSURL URLWithString:model.productAttribute.thumbnail] placeholderImage:[UIImage imageNamed:kPlacehodelImg]];
    
    _TitleLab.text = [NSString stringWithFormat:@"%@  %@", model.product.productName, model.productAttribute.tasteStr];
    
    _guiGeLab.text = [NSString stringWithFormat:@"规格 :%@",model.productAttribute.specificationsStr];
    
    _numberLab.text = [NSString stringWithFormat:@"%@箱",model.quantity];
}

- (void)setPlanModel:(ESSListModel *)planModel
{
    _planModel = planModel;
    [_headerImageV sd_setImageWithURL:[NSURL URLWithString:planModel.thumbnail] placeholderImage:[UIImage imageNamed:kPlacehodelImg]];
    
    _TitleLab.text = [NSString stringWithFormat:@"%@ %@", planModel.productName, planModel.tasteName];
    
    _guiGeLab.text = [NSString stringWithFormat:@"规格 :%@",planModel.specificationsName];
    
    _numberLab.text = [NSString stringWithFormat:@"%@箱",planModel.quantity];
    
}



@end
